package com.studyroom.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.studyroom.entity.OrderItem;
import com.studyroom.mapper.OrderItemMapper;
import com.studyroom.service.OrderItemService;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements OrderItemService {
    

    @Override
    public List<OrderItem> getOrderItems(Long orderId) {
        return baseMapper.getOrderItems(orderId);
    }
    
    @Override
    public List<OrderItem> getByOrderId(Long orderId) {
        LambdaQueryWrapper<OrderItem> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(OrderItem::getOrderId, orderId);
        return list(wrapper);
    }
} 